package edu.um.analyzer.exception;

import edu.um.token.Token;
import edu.um.variable.VariableType;

public class TypeMismatchException extends Exception {
  public TypeMismatchException(String msg, Token token) {
    super("Type Mismatch: " + msg + String.format(" at %d : %d",
        token.getLine(), token.getColumn()));
  }

  public TypeMismatchException(VariableType firstType, VariableType secondType,
      Token token) {
    super(String.format("Type Mismatch: %s - %s  at %d : %d",
        firstType, secondType, token.getLine(), token.getColumn()));
  }

  public TypeMismatchException(VariableType type, Object value, Token token) {
    super(String.format("Type Mismatch: %s - %s  at %d : %d",
        type, value, token.getLine(), token.getColumn()));
  }

}
